package com.alibaba.bean;

import java.text.SimpleDateFormat;
import java.util.Date;

public class User2 {
    private int userId;
    private String username;
    private String password;
    private String avatar;
    private String dailyNum;
    private String loginTimeStr;

    private Date now = new Date();
    private SimpleDateFormat dateFormate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

    public String getDailyNum() {
        int rand = (int)(Math.random()*10);
        dailyNum = rand + "";
        return dailyNum;
    }

    public void setDailyNum(String dailyNum) {
        this.dailyNum = dailyNum;
    }

    public String getLoginTimeStr() {
        int rand = (int)(Math.random()*10000)*60*1000;
        Date date = new Date(now.getTime() - rand);
        loginTimeStr = dateFormate.format(date);
        return loginTimeStr;
    }

    public void setLoginTimeStr(String loginTimeStr) {
        this.loginTimeStr = loginTimeStr;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }
}
